#pragma once

#include "utils/Timer.h"

//////////////////////////////////////////////////////////////////////
//
// Application is the entry point. You should create your
// scene and execute it through Applitacion.
//
//////////////////////////////////////////////////////////////////////

class Scene;

class Application {
	Scene* const mScene;
	Timer mTimer;

public:
	// Application owns scene's memory.
	Application(Scene* const scene);
	~Application();

	// Executes main loop where we process events
	// and update scene.
	void execute();

private:
	Application(const Application& app);
	const Application& operator=(const Application& app);

	// Process pending messages in message queue.
	// Returns true if close window message was processed.
	bool processMessages();

	void updateScene();

	// Computes the average frames per second, and also the 
	// average time it takes to render one frame. These stats 
	// are appended to the window caption bar.
	void calculateFrameStats();

};

